import React from 'react'
import { Table } from 'antd';
import '@/components/page/index.less'
interface IProps {
  list: any[]
}
function TableList (props: any) {
  // const [selectedRowKeys, setSelectedRowKeys] = useState<any>([]);
  const rowSelection = {
    selectedRowKeys: [],
    onChange: (selectedRowKeys: any, selectedRows: any) => {
      console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
    }
  };
  return (
    <div>
      <Table className='table_content' scroll={{ x: 1200, y:'calc(100vh - 370px)'}} sticky rowSelection={rowSelection} bordered columns={props.columns} dataSource={props.list} rowKey={function(record): string{return record}}/>
    </div>
  )
}
export default TableList
